using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using ProtoBuf;

namespace Game500.ClientServerCommon.Src
{
  /// <summary>
  /// Contains data of a scene object in a form of dictionary (property => value)
  /// </summary>
  [ProtoContract]
  [Serializable]
  public class ObjectDescriptor
  {
    public ObjectDescriptor()
    {
    }

    public ObjectDescriptor(int id, int resourceId)
    {
      Id = id;
      ResourceId = resourceId;
    }

    [ProtoMember(1)]
    public int Id { get; private set; }

    [ProtoMember(2)]
    public int ResourceId { get; set; }

    [ProtoMember(3)]
    public Vector3? Position { get; set; }

    [ProtoMember(4)]
    public float? Rotation { get; set; }

    [ProtoMember(5)]
    public bool? Visibility { get; set; }

    [ProtoMember(6)]
    public bool? Flip { get; set; }
  }

  [ProtoContract]
  [Serializable]
  public class SceneFrame
  {
    private List<ObjectDescriptor> myDataSection = new List<ObjectDescriptor>();
    private IDictionary<int, int>  myScore = new Dictionary<int, int>();

    [ProtoMember(2)]
    public List<ObjectDescriptor> DataSection
    {
      get { return myDataSection; }
      set { myDataSection = value; }
    }

    [ProtoMember(3)] 
    public IDictionary<int, int> Score
    {
      get { return myScore; }
      set { myScore = value; }
    }
  }
}